using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

public class UIUtility
{
	public static void InitBtn(GameObject root, Button btn, string path, UnityAction uAction)
	{
		Debug.Log(path);

		btn = root.transform.Find(path).GetComponent<Button>();
		btn.onClick.AddListener(uAction);
	}

	public static void InitImage(GameObject root, Image img, string path, Sprite sprite)
	{
		img = root.transform.Find(path).GetComponent<Image>();
		img.sprite = sprite;
	}

	public static void InitText(GameObject root, Text tex, string path, string content)
	{
		tex = root.transform.Find(path).GetComponent<Text>();
		tex.text = content;
	}
}
